<?php
/**
 * Created by PhpStorm.
 * User: 海峡
 * Date: 2021/1/6
 * Time: 10:30
 */

namespace App\Models\Traits;

trait Btn
{
    public function editBtn(string $route)
    {
    //        dd($route,request()->auths);
//        if (auth()->user()->username != config('rbac.super') && !in_array($route, request()->auths)) {
//            return '';
//        }
//        return '<a href="'.route($route,$this).'" class="label label-secondary redius">修改</a>';

    }
    //删除
    public function delBtn(string $route)
    {
        if (auth()->user()->username != config('rbac.super') && !in_array($route, request()->auths)) {
            return '';
        }
        return '<a href="'.route($route,$this).'" class="label label-danger redius">删除</a>';

    }
}